﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wicresoft.EKA.MVCExtensions;


namespace Wicresoft.EKA.NRemedy.MVC
{
    public static class BaseExtension
    {
        public static ARProxy<T> GetARProxy<T>(this Base base1) where T : ARBaseForm
        {
            ARLoginContext loginContext = ARLoginContextPool.Instance.GetLoginContext(base1.UserIdentify);
            return new ARProxy<T>(loginContext);
        }

        public static ARLoginContext GetARLoginContext(this Base base1)
        {
            return ARLoginContextPool.Instance.GetLoginContext(base1.UserIdentify);
        }

        public static IARServer GetARServer(this Base base1)
        {
            return ARLoginContextPool.Instance.GetLoginContext(base1.UserIdentify).ServerInstance;
        }

        public static BMC.ARSystem.Server GetBMCServer(this Base base1)
        {
            return ARLoginContextPool.Instance.GetLoginContext(base1.UserIdentify).ServerInstance.BMCServer;
        }
    }
}
